package com.csust.automaticteach.model.enums;

import cn.hutool.core.util.ObjUtil;
import lombok.Getter;

@Getter
public enum BizTypeEnum {
    CHAT_LEARN("对话聊天", 0),
    TEACHER("RAG对话", 1);
    //todo 可继续扩展

    private final String text;
    private final Integer value;

    BizTypeEnum(String text, Integer value) {
        this.text = text;
        this.value = value;
    }

    /**
     * 根据 value  获取 userRole
     *
     * @param value value
     * @return userRole
     */
    public static BizTypeEnum getEnumByValue(Integer value) {
        if (ObjUtil.isEmpty(value)) {
            return null;
        }
        for (BizTypeEnum role : values()) {
            if (role.value.equals(value)) {
                return role;
            }
        }
        return null;
    }
}
